package com.erp.mapper;

import com.erp.mapper.vo.GoodsAndGoodsType;
import com.erp.pojo.Goods;
import com.erp.pojo.GoodsExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface GoodsMapper {
    long countByExample(GoodsExample example);

    int deleteByExample(GoodsExample example);

    int deleteByPrimaryKey(Integer gId);

    int insert(Goods record);

    int insertSelective(Goods record);

    List<Goods> selectByExample(GoodsExample example);

    Goods selectByPrimaryKey(Integer gId);

    int updateByExampleSelective(@Param("record") Goods record, @Param("example") GoodsExample example);

    int updateByExample(@Param("record") Goods record, @Param("example") GoodsExample example);

    int updateByPrimaryKeySelective(Goods record);

    int updateByPrimaryKey(Goods record);

    List<GoodsAndGoodsType>findGoodsAndGoodsTypes();
    List<GoodsAndGoodsType>findGoodsTypes();

    List<Map>findAllGoods(@Param("map") Map<String, Object>map);
    int countGoods(@Param("map")Map<String, Object>map);

    int insertGoods(@Param("goodsList") List<Goods>goodsList);

    int updateGoods(@Param("goodsList") List<Goods>goodsList);
}